<script type="text/javascript">

  function newAsset() {
    selected_model=$('model_type').value;

//cheat for the moment and use the sop as a script
    if (selected_model == "script") {
      location.href = "<%= new_script_path -%>";
    }
    //else if (selected_model == "sop") {
    //  location.href = "<%= new_sop_path -%>";
    //}
   // else if (selected_model == "assay") {
    //  location.href = "<%= new_assay_path -%>";
    //}
   // else if (selected_model == "investigation") {
     // location.href = "<%= new_investigation_path -%>";
    //}
    else if (selected_model == "study") {
      location.href = "<%= new_study_path -%>";
    }
    //data_file is a survey
    else if (selected_model == "survey") {
      location.href = "<%= new_survey_path -%>";
    }
    //else if (selected_model == "investigation") {
    //  location.href = "<%= new_investigation_path -%>";
  //  }
    
  }

</script>

<% unless current_user.person.work_groups.empty? -%>
  <div id="new_asset" class="myexperiment_gadget">
    <b class="xtop"><b class="xb1"></b><b class="xb2"></b><b class="xb3"></b><b class="xb4"></b></b>

    <div class="header">
      New or upload
    </div>
  
    <div class="contents">
      <div style="text-align: center; padding-left: 0.5em;">
        <ul class="gadget_list">
          <form onsubmit="newAsset();return(false)">
            <%= new_creatable_selection %>
            <%= submit_tag "Go" %>
          </form>
        </ul>
      </div>
    </div>

    <b class="xbottom"><b class="xb5"></b><b class="xb6"></b><b class="xb7"></b><b class="xb1"></b></b>
  </div>
<% end -%>

